package com.car.datalayer.http;
import java.io.IOException;
import java.io.OutputStream;

import org.apache.http.entity.ContentProducer;


public class CHttpContentProvider implements ContentProducer{
	private CHttpRequest req;
	
	public CHttpContentProvider(CHttpRequest req){
		this.req = req;
	}

	@Override
	public void writeTo(OutputStream outstream) throws IOException {
		byte[] postContent = null;
		if(req != null){
			postContent = req.getPostContent();
		}
		if(postContent != null){
			outstream.write(postContent);
		}
		outstream.flush();
	}
	
}
